cmake_minimum_required(VERSION 3.10.2)

project("myx264test")
aux_source_directory(. SOURCE)
add_library(
        myx264test
        SHARED
        ${SOURCE})

find_library(
        log-lib
        log)
add_library(
        x264
        SHARED
        IMPORTED)
set_target_properties(x264 PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/${ANDROID_ABI}/lib/libx264.so)
include_directories(${CMAKE_SOURCE_DIR}/${ANDROID_ABI}/include)

SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -DNODEBUG -O3 -Wall")
SET(CMAKE_C_FILAGS "$ENV{CFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -DNODEBUG -O3 -Wall")
target_link_libraries(
        myx264test
        x264
        ${log-lib})